test(coverage): backfill toward >=80% SonarCloud new-code coverage#59
Merged
Conversation
Adds 112 new tests across 6 new classes targeting high-uncovered-line
files flagged by SonarCloud + local JaCoCo. Net project LINE coverage
moved 89.31% -> 89.94% (+120 covered lines, +0.63pp).
Per-file deltas (line coverage):
EnvVarOverlay.java 52.9% -> 100.0% (+47.1pp)
AzureMessagingDetector.java 76.6% -> 100.0% (+23.4pp)
AzureFunctionsDetector.java 79.2% -> 100.0% (+20.8pp)
LanguageEnricher.java 74.6% -> 88.1% (+13.5pp)
ModuleDepsDetector.java 78.9% -> 88.0% (+9.1pp)
ConfigDefDetector.java 74.6% -> 75.4% (+0.8pp)
Test additions:
EnvVarOverlayExtendedTest — 19 tests, all switch cases,
neo4j/mcp/observability overlays,
splitCsv edge cases, determinism
AzureMessagingDetectorTest — 21 tests (new file), SB + EH
clients named + generic fallbacks
AzureFunctionsDetectorTest — 15 tests (new file), every
trigger branch: HTTP, SB queue/topic,
Event Hub, Timer, CosmosDB, unknown
ConfigDefDetectorTest — 18 tests (new file), AST branches
for Kafka ConfigDef / @value /
@ConfigurationProperties with
deduplication and discriminator
guard checks
ModuleDepsDetectorTest — 18 tests (new file), Maven +
Gradle (Groovy) + dep extraction
LanguageEnricherExtendedTest — 14 tests, file_type skip list,
missing file handling, null
filePath, minified-file heuristic,
fqn/id registry, mjs/cjs/pyw
Follow-up (bugs observed while testing, NOT fixed here):
- ModuleDepsDetector dispatch order: .gradle ends-with check matches
settings.gradle before the dedicated settings.gradle branch, leaving
detectGradleSettings() unreachable via detect().
- ExpressRouteDetector defines detectWithAst but the base detect()
in AbstractTypeScriptDetector routes only to detectWithRegex, so
the AST method is currently dead code.
- RepositoryIdentityTest has two pre-existing env-dependent failures
on main (resolve_gitRepoWithCommit_commitShaPresent,
resolve_detachedHead_branchIsNull) - unrelated to this change.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Goal
Raise SonarCloud's
new_coveragemetric with 112 new meaningful testsagainst the highest-uncovered-line files flagged by local JaCoCo.
Note on the premise: the task cited
new_coverage = 70.7% vs 80% threshold, but SonarCloud currently reportsnew_coverage = 83.74%on
main(quality gateOK). The 70.7% number matches PR #53's owndecoration, not the branch metric. This PR still adds the requested
tests to strengthen the margin and cover paths flagged as risky by
local JaCoCo.
Local JaCoCo deltas
Project-level:
Per-file (line coverage, highest-impact first):
config/unified/EnvVarOverlay.javadetector/jvm/java/AzureMessagingDetector.javadetector/jvm/java/AzureFunctionsDetector.javaintelligence/extractor/LanguageEnricher.javadetector/jvm/java/ModuleDepsDetector.javadetector/jvm/java/ConfigDefDetector.javadetector/typescript/ExpressRouteDetector.javaTest count
Before: 3,278 tests. After: 3,390 (+112 new tests).
What was NOT covered and why
ExpressRouteDetector.detectWithAst(50 dead lines) —AbstractTypeScriptDetector.detect()routes unconditionally to
detectWithRegex, so the AST override isnever invoked. Listed as follow-up.
ConfigDefDetector.detectWithRegex—AbstractJavaParserDetector.parse()recovers from most invalid Java, so the regex fallback is not
reliably reachable without reflection. Kept narrow AST-branch
coverage; flagged as a cleanup candidate.
ModuleDepsDetector.detectGradleSettings(~17 lines) — the dispatchchain checks
.endsWith(".gradle")before.endsWith("settings.gradle"),so any filename matching the latter has already been routed to
detectGradle. ThedetectGradleSettingsbranch is unreachable fromdetect(). Flagged as a follow-up.Bugs observed while writing tests (NOT fixed here)
Per task rules, these are filed as follow-ups:
ModuleDepsDetector.detect()dispatch-order bug:detectGradleSettings()is unreachable because the
.gradlesuffix check shadows thesettings.gradlecheck.ExpressRouteDetector.detectWithAst()is dead code — never invokedbecause the base
AbstractTypeScriptDetector.detect()doesn't callthe AST variant.
RepositoryIdentityTesthas two pre-existing environment-dependentfailures on
main(resolve_gitRepoWithCommit_commitShaPresent,resolve_detachedHead_branchIsNull). Unrelated to this PR; buildalso fails on unmodified
mainwith these same two assertions.How to verify
Test run result: 3,390 tests, only the two pre-existing
RepositoryIdentityTestfailures remain (present onmaintoo).Hard rules compliance
src/main(test-only PR)@Disabled, noassumeTrue(false), no flaky constructsThread.sleep, no timing dependence@Configurationclasses🤖 Generated with Claude Code